Skip to content

util/sequence.jam review#592

Closed
paolopas wants to merge 4 commits into
bfgroup:mainfrom
paolopas:jamme-4
Closed

util/sequence.jam review#592
paolopas wants to merge 4 commits into
bfgroup:mainfrom
paolopas:jamme-4

Conversation

@paolopas

Copy link
Copy Markdown
Contributor
  • removed unused 'import assert'
  • better module Note and comments in transform, less, insertion-sort, merge, compare, join, and __test__ rules
  • useless transform Jam implementation removed
  • 'result__' variable renamed to 'result' in merge rule
  • useless select-highest-ranked Jam implementation removed
  • fixed handling of 'ordered' predicate in insertion-sort rule

+ removed unused 'import assert'
+ better module Note and comments in transform, less, insertion-sort,
merge, compare, join, and __test__ rules
+ useless transform Jam implementation removed
+ 'result__' variable renamed to 'result' in merge rule
+ useless select-highest-ranked Jam implementation removed
+ fixed handling of 'ordered' predicate in insertion-sort rule
paolopas added a commit to paolopas/b2 that referenced this pull request Apr 18, 2026
@paolopas

Copy link
Copy Markdown
Contributor Author

Important

René, please merge the 6abf2af only if you think that the removal of Jam transform rule may cause backward compatibility issues, otherwise do not use it!

When Watanabe added the native implementation (was in 2013 with the 2a75a35) he did things with his usual care, even adding a guard to the NATIVE_RULE, that is he wrote below the Jam implementation of the rule

if [ HAS_NATIVE_RULE sequence : transform : 1 ]
{
    NATIVE_RULE sequence : transform ;
}

In my review I removed both the guard and the Jam rule, trusting that the interpreter always has the native version.

But if there were a possibility that an old engine was dealing with the new sequence.jam this creates a problem since the old engine without the implementation of the rule in Jam (which I removed) and the guard on NATIVE_RULE (which I also removed) would encounter an error.

So if you think this might happen then please use 6abf2af which restores both.

The reason I removed them is that when Kniazev implemented native unique (in 2023, see d349465), he didn't use any guard for NATIVE_RULE.
And this leads me to think that the case of an old engine with new jamfiles should not occur, and probably Watanabe was too scrupulous or was concerned with ensuring the version of the native transform rule was = 1 (I will return to this aspect when I deal with the guard, i.e. the HAS_NATIVE_RULE.)

grafikrobot pushed a commit that referenced this pull request Jun 12, 2026
+ better documentation for struct _rule.exported attribute (what an unfortunate name) provided by comments in rules.h and builtins.cpp
+ more context added to comment in define_rule in rules.cpp
+ escaped <= to avoid AsciiDoc arrow in §4.2 Boost.Jam Language
+ capitalized "Jam", when talking about the language
+ updated error example in §12.2.3. Rules - Argument lists
+ updated documentation for builtin IMPORT in §12.2.7 Modules
+ little more about file breakpoints in §7.1.3 Breakpoints
+ debug.adoc updates
+ SUBST documentation added in §12.2.4 Builtin Rules
+ better documentation for exported param of new_rule_body function in rules.cpp
+ updated §6.5.11 sequence documentation to align with #592 changes

fixes #588
@grafikrobot

Copy link
Copy Markdown
Member

And this leads me to think that the case of an old engine with new jamfiles should not occur, and probably Watanabe was too scrupulous or was concerned with ensuring the version of the native transform rule was = 1 (I will return to this aspect when I deal with the guard, i.e. the HAS_NATIVE_RULE.)

Once upon a time, when Watanabe did this, such mixing was a constantly occurring headache. As the b2 binary would be installed by system package managers. But people, as in Boost devs, would run that instead of the in-tree one. I resolved this though when I made b2 search for the "attached" build jam files instead of relying on the search path. So, yes, it's safe to remove the native rule checks. They are pointless at this time.

@grafikrobot grafikrobot self-assigned this Jun 16, 2026
@grafikrobot grafikrobot moved this to 🏗 In progress in BFG Tasks Jun 16, 2026
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to ✅ Done in BFG Tasks Jun 17, 2026
@paolopas paolopas deleted the jamme-4 branch June 22, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants